package server

import (
	"context"
	"qq_service/delete_same/protobuf/pb"
)

//服务结构体
type DeleteSame struct {
	pb.UnimplementedDeleteSameServiceServer
}

//HelloRequest请求
//HelloResponse返回结果
func (h DeleteSame) DeleteSame(ctx context.Context, in *pb.QQlistRequest) (*pb.QqListResponse, error) {
	resp := new(pb.QqListResponse)
	mymap := make(map[string]int)
	for _, QQnum := range in.Qq {
		_, isok := mymap[QQnum]
		if !isok {
			mymap[QQnum] = 1
		}
	}
	QQwithoutSame := []string{}
	for k, _ := range mymap {
		QQwithoutSame = append(QQwithoutSame, k)
	}

	resp.Qq = QQwithoutSame
	resp.Email = in.Email
	resp.Word = in.Word
	return resp, nil
}
